<template>
  <div>
    <!-- 最外层容器 -->
    <el-container>
      <!-- 上半部分：顶栏 -->
      <el-header class="layout-header">
        <h1>EMS教育后台管理系统</h1>
      </el-header>
      <!-- 下半部分：容器 -->
      <el-container class="layout-body">
        <!-- 下半部分的左侧边栏 -->
        <el-aside class="layout-aside">
          <!-- router属性用于跳转对应页面-->
          <el-menu
              router
              :default-active="activeMenuItemPath"
              class="el-menu-vertical-demo"
              background-color="#222c32"
              text-color="white"
              active-text-color="#409eff">
            <el-menu-item index="/sys-admin">
              <i class="el-icon-s-home"></i>
              <span slot="title">首页</span>
            </el-menu-item>
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-school"></i>
                <span>院系管理</span>
              </template>
              <el-menu-item index="/sys-admin/main/faculty/insert">添加院系</el-menu-item>
              <el-menu-item index="/sys-admin/main/faculty/list">院系列表</el-menu-item>
              <el-menu-item index="/sys-admin/main/major/insert">添加专业</el-menu-item>
              <el-menu-item index="/sys-admin/main/major/list">专业列表</el-menu-item>
              <el-menu-item index="/sys-admin/main/grade/list">年级列表</el-menu-item>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-notebook-2"></i>
                <span>课程管理</span>
              </template>
              <el-menu-item index="/sys-admin/main/course/list">课程列表</el-menu-item>
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-s-custom"></i>
                <span>教师管理</span>
              </template>
              <el-menu-item index="/sys-admin/main/teacher/list">教师列表</el-menu-item>
              <el-menu-item index="/sys-admin/main/teacher/insert">录用教师</el-menu-item>
              <el-menu-item index="/sys-admin/main/teacher/teach">教师授课信息</el-menu-item>
              <el-menu-item index="/sys-admin/main/teacher/search">查询教师信息</el-menu-item>
            </el-submenu>
            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-user-solid"></i>
                <span>学生管理</span>
              </template>
              <el-menu-item index="/sys-admin/main/student/list">学生信息管理</el-menu-item>
              <el-menu-item index="/sys-admin/main/student/dropList">退学学生信息管理</el-menu-item>
            </el-submenu>
            <el-submenu index="5">
              <template slot="title">
                <i class="el-icon-document-checked"></i>
                <span>成绩管理</span>
              </template>
              <el-menu-item index="5-1">55511111</el-menu-item>
              <el-menu-item index="5-2">55522222</el-menu-item>
            </el-submenu>
            <el-submenu index="6">
              <template slot="title">
                <i class="el-icon-video-camera-solid"></i>
                <span>校园新闻</span>
              </template>
              <el-menu-item index="/sys-admin/main/news/add-new">在线投稿</el-menu-item>
              <el-menu-item index="/sys-admin/main/news/list">新闻列表</el-menu-item>
            </el-submenu>
          </el-menu>
        </el-aside>
        <!-- 下半部分的右侧主体部分 -->
        <el-main class="layout-main">
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeMenuItemPath: ''
    };
  },
  methods: {

  },
  mounted() {
    let path = this.$router.currentRoute.path;
    this.activeMenuItemPath = path;
  }
}
</script>

<style>
.layout-header {
  background: #1684b0;
}

.layout-header h1 {
  color: white;
  text-align: left;
  line-height: 60px;
}

.layout-aside{
  background-color: #222c32;
}

.layout-aside i{
  color: white !important;
}

.layout-body{
  position: absolute;
  top:60px;
  bottom: 0;
  left: 0;
  right: 0;
}

.el-menu-item.is-active{
  background:  #2d3c4d !important;
}

</style>

